package com.chaopei.base2;

import java.io.File;

/**
 * @Author Corday 天涯
 * @Date 2022/3/6 16:37
 */
public class MyFileAndIO {
    public static void main(String[] args) {
        File f = new File("d:/temp");
        dispFiles(f);
    }

    public static void dispFiles(File file) {
        if (file.isFile()) {
            System.out.println("文件:" + file.getName());
        } else {
            System.out.println("目录:" + file.getName());
            File[] fs = file.listFiles();
            for (File f : fs) {
                dispFiles(f);
            }
        }
    }
}
